package model

import (
	"time"
)

type Goods struct {
	Id        int
	Name      string
	Stock     int
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time
}

func (goods *Goods) Get(goodsId int) bool {
	return db.Find(&goods, goodsId).RecordNotFound()
}

func (goods *Goods) StockOut() bool {
	if goods.Stock <= 0 {
		return true
	}
	return false
}